package com.example.system.model;

import cn.hutool.core.util.StrUtil;
import com.example.system.enums.OrderStatus;
import lombok.Data;
import lombok.ToString;

import java.time.LocalDateTime;
import java.util.List;

@Data
@ToString
public class Order {
    private String orderId;
    private List<Item> items;
    private OrderStatus status;
    private double totalPrice;
    private LocalDateTime createTime;
    private String remark;

    public void appendRemark(String remarkMsg) {
        if (StrUtil.isBlank(this.remark)) {
            this.remark = remarkMsg;
        } else {
            this.remark = this.remark + "\n" + remarkMsg;
        }
    }

}
